/*
 * @Descripttion: 说明
 * @version: V1.0
 * @Author: GaoWei
 * @Date: 2021-04-25 12:11:55
 * @LastEditors: GW
 * @LastEditTime: 2021-12-18 16:26:57
 */
import { axios } from '../../utils/request'

const api = {
    save: '/po/purchaseOrderMain/save',
    examine: '/po/purchaseOrderMain/examine',
    delete: '/po/purchaseOrderMain/delete',
    getcode: '/po/purchaseOrderMain/getCode',

    saveOrderForVendor: '/po/purchaseOrderMain/saveOrderForVendor',

    closed: '/po/purchaseOrderMain/closed',
}


/**
 * 打开or关闭
 */
export function closed(data) {
    return axios({
        url: api.closed,
        method: "get",
        params: data
    })
}


/**
 * 保存采购订单
 */
export function save(data) {
    return axios({
        url: api.save,
        method: "post",
        data: data
    })
}

/**
 * 审核采购订单
 */
export function examine(data) {
    return axios({
        url: api.examine,
        method: "get",
        params: data
    })
}

/**
 * 删除采购订单
 */
export function remove(data) {
    return axios({
        url: api.delete,
        method: "DELETE",
        params: data
    })
}

/**
 * 获取单据编号
 */
export function getCode(data) {
    return axios({
        url: api.getcode,
        method: "get",
        params: data
    })
}

/**
 * 请购单 按 供应商 分单 采购订单
 */
export function saveOrderForVendor(data) {
    return axios({
        url: api.saveOrderForVendor,
        method: "post",
        data: data
    })
}


/**
 * 单据提交
 */
 export function submitOrder (data) {
    return axios({
        url: '/po/purchaseOrderMain/submit',
        method: "get",
        params: data
    })
}
